<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['设备事件管理','设备状态事件']" icon="fa fa-warning" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>设备状态事件</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">				
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>	
								<div class="top_module">
                                    <span class="module_text">设备ID</span>
                                    <input type="text" class="module_inp top_module_select" [(ngModel)]="deviceId" placeholder="设备ID"/>
                                </div>
								<div class="top_module">
									<span class="module_text">事件类型</span>
									<select name="" class="top_module_select" [(ngModel)]="eventType">
										<option value="">全部</option>
										<option value="1">锂电池低电量警告</option>
										<option value="2">硬件状态</option>
										<option value="3">GPRS网络状态</option>
										<option value="4">IO状态</option>
										<option value="5">GPS定位状态</option>
										<option value="6">GPS天线状态</option>
										<option value="7">GPS可视卫星数</option>
										<option value="8">传感器通道状态</option>
										<option value="9">采集器状态</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1"  autocomplete="off" placeholder="选择开始时间"/>
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2"  autocomplete="off" placeholder="选择结束时间"/>
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
									
								</div>
								
								<button  type="button"  class="btn btn-primary" (click)="table_search()">查询</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="设备ID、事件类型、事件内容">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>设备ID</th>
										<th>车牌号码</th>
										<th>事件类型</th>
										<th>事件内容</th>
										<th>经纬度</th>
										<th>采集时间</th>
										<th>创建时间</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.deviceId}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.typeName}}</td>
										<td>{{row.message}}</td>
										<td>
											<span>{{row.lng}}</span><span *ngIf="row.lng && row.lat">，</span><span>{{row.lat}}</span>
										</td>
										<td>{{row.uploadDate}}</td>
										<td>{{row.createTime}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>